<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <body>
        <ui:composition>
            <h:outputStylesheet library="css" name="tabBar/tabBar.css"></h:outputStylesheet>
            <h:outputStylesheet library="css" name="tabBar/tabBar_desktop.css" media="screen and (min-width:1025px) and (max-width:1600px)"></h:outputStylesheet>
            <h:outputStylesheet library="css" name="tabBar/tabBar_desktop_wide.css" media="screen and (min-width : 1601px)"></h:outputStylesheet>
            <h:outputStylesheet library="css" name="tabBar/tabBar_tablet.css" media="screen and (min-device-width : 768px) and (max-device-width : 1024px), screen and (max-width:1024px)"></h:outputStylesheet>
            <h:outputStylesheet library="css" name="tabBar/tabBar_smartphone.css" media="screen and (min-device-width : 320px) and (max-device-width : 767px), screen and (max-width:767px)"></h:outputStylesheet>
            <h:form id="barForm" class="barForm noSmartphone">
                
                <p:tabMenu activeIndex="#{tabBarBean.activeIndex}" widgetVar="barWidget" styleClass="barTabMenu noMargin noBorder" rendered="#{loginBean.selectedUser.candidate!=null}">  
                    <p:menuitem ajax="false" value="#{messages.Profile}" action="#{tabBarBean.changeCandidateIndex(0)}"/>  
                    <p:menuitem ajax="false" value="#{tabBarBean.notificationsOfCandidate()}" action="#{tabBarBean.changeCandidateIndex(1)}"/>
                    <!--<p:menuitem value="#{messages.Offers}" action="#{tabBarBean.changeCandidateIndex(4)}"/>!-->
                    <p:menuitem ajax="false" value="#{messages.Preferences}" action="#{tabBarBean.changeCandidateIndex(2)}"/> 
                    <p:menuitem async="true" value="#{messages.Contact}" update=":suggestionsForm:suggestionsDialog" oncomplete="PF('suggestionsDialog').show();"/> 
                </p:tabMenu>
                <p:tabMenu activeIndex="#{tabBarBean.activeIndex}" widgetVar="barWidget" styleClass="barTabMenu noBorder" rendered="#{loginBean.selectedUser.company!=null}">  
                    <p:menuitem ajax="false" value="#{messages.Edit}" action="#{tabBarBean.changeCompanyIndex(0)}"/> 
                    <p:menuitem ajax="false" value="#{messages.Searchs}" action="#{tabBarBean.changeCompanyIndex(1)}"/> 
                    <p:menuitem ajax="false" value="#{messages.Folders}" action="#{tabBarBean.changeCompanyIndex(2)}"/>
                    <p:menuitem ajax="false" value="#{messages.Credits}" action="#{tabBarBean.changeCompanyIndex(3)}"/>
                    <p:menuitem ajax="false" value="#{messages.Preferences}" action="#{tabBarBean.changeCompanyIndex(4)}"/>
                </p:tabMenu>
                <p:tabMenu activeIndex="#{tabBarBean.activeIndex}" widgetVar="barWidget" styleClass="barTabMenu noMargin noBorder" rendered="#{loginBean.selectedUser.userType.idUserType==3}">  
                    <p:menuitem ajax="false" value="#{messages.Index}" action="#{tabBarBean.changeAdminIndex(0)}"/>
                    <p:menuitem ajax="false" value="#{messages.Company}" action="#{tabBarBean.changeAdminIndex(1)}"/>
                    <p:menuitem ajax="false" value="#{messages.Candidate}" action="#{tabBarBean.changeAdminIndex(2)}"/>
                    <p:menuitem ajax="false" value="#{messages.PublicRelationships}" action="#{tabBarBean.changeAdminIndex(3)}"/>
                    <p:menuitem ajax="false" value="#{messages.ReportedUsers}" action="#{tabBarBean.changeAdminIndex(4)}"/>
                    <p:menuitem ajax="false" value="#{messages.Statistics}" action="#{tabBarBean.changeAdminIndex(5)}"/>
                </p:tabMenu>
                <p:tabMenu activeIndex="#{tabBarBean.activeIndex}" widgetVar="barWidget" styleClass="barTabMenu noMargin noBorder" rendered="#{loginBean.selectedUser.publicRelations!=null}">  
                    <p:menuitem ajax="false" value="#{messages.Index}" action="#{tabBarBean.changePublicRelationsIndex(0)}"/>
                    <p:menuitem ajax="false" value="#{messages.Preferences}" action="#{tabBarBean.changePublicRelationsIndex(1)}"/>
                </p:tabMenu>
            </h:form>
            <h:form rendered="#{loginBean.selectedUser.candidate!=null}" id="barFormSmartphone" class="displayNone smartphone">
                    <h:outputStylesheet library="css" name="bar/bar.css"></h:outputStylesheet>
                    <h:outputStylesheet library="css" name="bar/bar_smartphone.css" media="screen and (min-device-width : 320px) and (max-device-width : 767px), screen and (max-width:767px)"></h:outputStylesheet>

                    <div id="bar" class="homeBar fixed">
                        <p:commandLink process="@this" styleClass=" logo" action="#{loginBean.goIndex()}">
                            <h:graphicImage library="images" style="width:100%" alt="#{indexMessages.LogoAlt}" name="logo.png"></h:graphicImage>
                        </p:commandLink>
                        <span class="ui-button-text menuButton floatRight displayNone smartphone bodyFont inlineBlock">#{indexMessages.Menu}</span>
                        <div id="navBar" class="overflowHidden height0 textAlignRight">
                            <ul class="barMenu">
                                <li class="barMenuItem bodyFont textAlignRight">
                                    <p:commandLink ajax="false" process="@this" styleClass="ui-button-text displayNone smartphone" action="#{tabBarBean.changeCandidateIndex(0)}" value="#{messages.Profile}"></p:commandLink>
                                </li>
                                <li class="barMenuItem bodyFont textAlignRight">
                                    <p:commandLink ajax="false" process="@this" styleClass="ui-button-text displayNone smartphone" value="#{tabBarBean.notificationsOfCandidate()}" action="#{tabBarBean.changeCandidateIndex(1)}"></p:commandLink>
                                </li>
                                <li class="barMenuItem bodyFont textAlignRight">
                                    <p:commandLink ajax="false" process="@this" styleClass="ui-button-text displayNone smartphone" value="#{messages.Preferences}" action="#{tabBarBean.changeCandidateIndex(2)}"></p:commandLink>
                                </li>
                                <li class="barMenuItem bodyFont textAlignRight">
                                    <p:commandLink ajax="false" process="@this" styleClass="ui-button-text displayNone smartphone" value="#{messages.Contact}" action="/views/smartphone/candidate/Suggestions?faces-redirect=true"></p:commandLink>
                                </li>
                                <li class="barMenuItem bodyFont textAlignRight">
                                    <p:commandLink ajax="false" process="@this" styleClass="ui-button-text displayNone smartphone" value="#{messages.Logout}" action="#{loginBean.logout()}"></p:commandLink>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <h:outputScript library="javascript" name="bar.js"></h:outputScript>
            </h:form>
            <h:form rendered="#{loginBean.logedCandidate()!=null}">
                <p:growl id="notificationGrowl"></p:growl>
                <p:socket onMessage="handleMessageNotification" channel="/notification/#{newEditCandidateBean.candidate.user.idUser}"/>  
                <p:remoteCommand async="true" name="notificationCommand" actionListener="#{notificationsUserBean.recieveNotification}" update="notificationGrowl :barForm" ></p:remoteCommand>
                <script type="text/javascript">  
                    function handleMessageNotification(notificationData) {
                        notificationCommand([{name: 'idNotification', value: notificationData}]);
                    }  
                </script>  
            </h:form>
        </ui:composition>
    </body>
</html>

